package com.gxuwz.service;

import java.util.List;
import java.util.Map;

import org.springframework.transaction.annotation.Transactional;

import com.gxuwz.pojo.DataEntity;
import com.gxuwz.pojo.SysUser;
import com.gxuwz.pojo.Topic;

@Transactional
public interface IDataService {

	/**
	 * 创建数据表
	 * @param tableName
	 * @param topicList
	 */
	public void createDB(String tableName, List<Topic> topicList);
	
	/**
	 * 创建允许重复填写的数据表
	 * @param tableName
	 * @param topicList
	 */
	public void createDBT(String tableName, List<Topic> topicList);
	
	
	/**
	 * 增加填写者
	 * @param tableName
	 * @param writers
	 */
	public void addWriter(String tableName, List<SysUser> writers);
	/**
	 * 获得填写者
	 * @param tableName
	 * @return
	 */
	public List<SysUser> getWriter(String tableName);
	
	/**
	 * 模糊查询
	 * @param tableName
	 * @param dataEntity
	 * @param topicList
	 * @return
	 */
	public List<DataEntity> find(String tableName, DataEntity dataEntity, List<Topic> topicList);
	
	/**
	 * 更新操作，map中包含数据id
	 * @param tableName
	 * @param map
	 */
	public void update(String tableName, Map<String,String> map);
	
	/**
	 * 是否填写者
	 * @param tableName
	 * @param userId
	 * @return
	 */
	public boolean isWriter(String tableName, String userId);
	
	/**
	 * 修改表格结构
	 * @param tableName
	 * @param topicList
	 */
	public void editTable(String tableName, List<Topic> topicList);
	
	/**
	 * 复制数据
	 * @param newName
	 * @param oldName
	 */
	public void copyData(String newName, String oldName, List<Topic> newTopic, List<Topic> oldTopic);
	
	public void addData(String tableName, Map<String,String> map);
	
	public List<SysUser> getMailUser(String tableName);
}
